#include "popwidget.h"
#include "ui_popwidget.h"
#include <QGraphicsDropShadowEffect>

popwidget::popwidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::popwidget)
{
    ui->setupUi(this);
    setShadowEffect(this);
    connect(ui->pushButton, &QPushButton::clicked, this, &popwidget::hide);
    ui->pushButton_2->setDisabled(1);
    ui->pushButton_3->setDisabled(1);
    ui->pushButton_4->setDisabled(1);
    //ui->functions->setParent(this);
}

popwidget::~popwidget()
{
    delete ui;
}

void popwidget::setShadowEffect(QWidget * w)
{
    QGraphicsDropShadowEffect * effect = new QGraphicsDropShadowEffect(w);
    effect->setOffset(0, 0);//设置阴影距离
    effect->setColor(QColor(0,0,0,90));//设置阴影颜色
    effect->setBlurRadius(10);//设置阴影圆角
    w->setGraphicsEffect(effect);
}

void popwidget::addsettingwidget(QWidget * child)
{
    ui->label->setText("设置");
    child->setParent(ui->functions);

}

void popwidget::addloginwidget(QWidget * child)
{
    ui->label->setText("用户");
    child->setParent(ui->functions);
}
